package ins.wink.service.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import ins.wink.entity.History;
import ins.wink.mapper.HistoryMapper;
import ins.wink.service.HistoryService;
/**
 * 历史记录接口实现方法
 * @author ASUS
 *
 */
@Service
@Transactional
public class HistoryServiceImpl implements HistoryService {
	//注入历史记录mapper层
	@Autowired
	private HistoryMapper historyMapper;
	//查询历史记录
	@Override
	public List<History> listHistorys() {
		List<History> list = historyMapper.listHistory();
		return list;
	}
	//添加历史记录
	@Override
	public void addHistorys(History history) {
		historyMapper.addHistory(history);
	}
	//简记码 名称 仓库编号查询
	@Override
	public List<History> historyLikeNms(String nm, String goodname, String storeid) {
		//实例化新的map集合
		Map<String, Object>map = new HashMap<String, Object>();
		map.put("nm", nm);
		map.put("goodname",goodname);
		map.put("storeid",storeid);
		List<History> h =historyMapper.historyLikeNm(map);
		return h;
	}
	//添加出库历史记录
	@Override
	public void updateHistorys(History history) {
		historyMapper.updateHistory(history);
	}

}
